package training.oop.inheritance.demo;

import sumit.HelloWorld;
import training.oop.inheritance.AbstractParent;
import training.oop.inheritance.Child;
import training.oop.inheritance.ChildForAbstractParent;

public class InheritanceDemo {

	public static void main(String[] args) {

		Child child = new Child("Ambika","0002");
		child.sayHelloFromParent("Baiju");
		child.sayHelloFromChild("baiju");
		
		

		// Look at the type. it is AbstractParent but the implementation (new
		// operator) is for ChildForAbstractParent.
		//you can not have objects for abstract class.
		//AbstractParent absParent1 = new AbstractParent();
		AbstractParent absParent2 = new ChildForAbstractParent();

		// you can always create in the regular way, but here we are not really
		// using
		// inheritance such as.
		// ChildForAbstractParent absParent1 = new ChildForAbstractParent();

		absParent2.sayHelloFromAbstractParent("Nisha");
		absParent2.sayHelloWithNoImplementation("Ambika");

		// how to user class from different package
		// first import the class
		HelloWorld hw = new HelloWorld();
		hw.sayHello();
		
		
		
	}

}
